<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Student</title>
</head>
<body>
    <h1>Hello</h1>
<!--    获取从controller中拿到数据库中的值-->
<!--    {volist name='list' id='vo'}-->
<!--        {$vo.name}-->
<!--    {/volist}-->

    <table>
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>性别</th>
            <th>班级</th>
            <th>年龄</th>
            <th>操作</th>
        </tr>
        {volist name='list' id='vo'}
        <tr>
            <td>{$vo.id}</td>
            <td>{$vo.name}</td>
<!--            性别数字转换成文字显示-->
            <td>
                {if $vo.sex == 1 } 男
                {elseif $vo.sex == 2 } 女
                {/if}
            </td>
            <td>{$vo.classes}</td>
            <td>{$vo.age}</td>
            <td>
                <a href="{:url('student/edit' , ['id' => $vo.id] )}" > 修改</a>
                <a href="{:url('student/del' , ['id'=> $vo.id] )}" > 删除</a>
            </td>
        </tr>
        {/volist}
        <tr>
            <td>
                <a href="{:url('student/add')}" > 添加 </a>
            </td>
        </tr>
    </table>
</body>
</html>